import { Vec2 } from "cc"
import { StateDefine } from "../StateDefine"
import { ActorState } from "./ActorState"
export class Idle extends ActorState {
    onEnter() {
        this.actor.rigidBody.linearVelocity = Vec2.ZERO
        let hasIdle = this.animation.getState(StateDefine.Idle)

        if (hasIdle) {
            console.log(hasIdle, 'hasIdle')
            this.animation.play(StateDefine.Idle)
        }
    }
    onExit() {

    }
    update(deltaTime: number): void {

    }
    canTransit(to: StateDefine): boolean {
        if (to == StateDefine.Idle) {
            return false
        }
        return true
    }
}

